/**
 * @file oled_port.c
 * @brief 
 * @author 2bam 
 * @version 1.0
 * @date 2024-12-29
 * @copyright Copyright (c) 2024  NULL
 * 
 * @change log:
 * Date           Version Author   Describe
 * 2024-12-29     1.0     2bam     first version
 */


/* Includes -------------------------------------------------------------------*/
#include "oled_port.h"
#include "config.h"
/* define ---------------------------------------------------------------------*/

/* typedef --------------------------------------------------------------------*/

/* variables ------------------------------------------------------------------*/

/* Private function prototypes ------------------------------------------------*/




void OLED_SendBuff(uint8_t buff[8][128])
{
    static uint8_t sendBuffer[OLED_COLUMN + 1];
    sendBuffer[0] = 0x40;
    for (uint8_t i = 0; i < OLED_PAGE; i++)
    {
        OLED_SendCmd(0xB0 + i);     // 设置页地址
        OLED_SendCmd(0x02);         // 设置列地址低4位
        OLED_SendCmd(0x10);         // 设置列地址高4位
        memcpy(sendBuffer + 1, buff[i], OLED_COLUMN);
        OLED_Send(sendBuffer, OLED_COLUMN+1);
    }

    // for(uint8_t i=0;i<8;i++)  
	// {  
	// 	OLED_WriteByte (0xb0+i,OLED_CMD);    //设置页地址（0~7）(b0-b7)
	// 	OLED_WriteByte (0x00,OLED_CMD);      //设置显示位置—列低地址
	// 	OLED_WriteByte (0x10,OLED_CMD);      //设置显示位置—列高地址   
	// 	OLED_WriteByteArrayData(buff[i],128); //写一页128个字符
	// } //更新显示
}